import React, { Component } from 'react';

import Item from './components/Item'
import axios from 'axios'
class Index extends Component {
    constructor(props){
        super(props);
        this.state = {
            music:[]
        }
    }
    render() {
        return (
            <div className='container'>
                <Item data={this.state.music}></Item>
            </div>
        );
    }
    componentDidMount(){
        axios.get("http://122.112.161.135:3000/top/playlist?cat=%E5%8D%8E%E8%AF%AD").then(res=>{
            this.setState({
                music:res.data.playlists
            })
        })
    }
    
}

export default Index;
